package com.simtop.car.pojo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

import java.util.Date;

/**
 * 用户实体
 */
@Data
@JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY)
//属性为空或者NULL都不序列化
public class User {
    private Integer id;//主键id
    private String username;//用户名
    private String loginName;//登录名
    private String password;//登陆密码
    private String email;//邮箱
    private Integer roleId;//角色id
    private Date createTime;//创建时间
    private String school;//学校
    private String province;//省份
    private String city;//城市
    private String checkCode;
    private long loginTime;

    // important 验证码不存入数据库，存入redis

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", loginName='" + loginName + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", roleId=" + roleId +
                ", createTime=" + createTime +
                ", school='" + school + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", checkCode='" + checkCode + '\'' +
                ", loginTime=" + loginTime +
                '}';
    }
}
